package smartq.app;
//package com.app.smart_q;
//
//import java.util.ArrayList;
//import android.app.Activity;
//import android.content.Context;
//import android.content.Intent;
////import android.graphics.Typeface;
//import android.os.Bundle;
//import android.os.Handler;
//import android.os.Vibrator;
//import android.util.Log;
////import android.view.View;
//import android.view.Window;
//import android.widget.Button;
////import android.widget.TextView;
//import android.widget.Toast;
//
//import com.app.project_nfc.R;
//import com.app.smart_q.InfoDB;
//import com.app.smart_q.InfoEntry;
//
//public class bookActivity extends Activity {
//
//	public String check;
//	private Context context;
//	private InfoDB db;
//	private ArrayList<InfoEntry> infos;
//	public static String CheckdataName;
//	public static String CheckdataPhone;
//	public String phone;
//	public String status = "";
//	public String qNumberFromMYSQL;
//	public String Q = "";
//	public String STATUS = "";
//	public static String p;
//	public static String phoneshare;
//	public static String phonesql;
//	public static String finishcheck = "";
//	public static String Qoutput = "";
//	public static Handler Qnumberchecklast;
//	public static int Qnumberchecklastint;
//	public static String Statuschecklaststring = "";
//	public Vibrator vi;
//	public static int a = 1;
//	public static int b = 1;
//	public static String StatusOutput = "";
//	int num = 0, notificationID = 1;
////	private TextView booking_header;
//	public boolean Checkclick;
//	//public long[] pattern = { 0, 1000, 500 };
//	public static Button btStart;
//	public static Button btStop;
//	public Intent myIntent;
//
//	@Override
//	public void onCreate(Bundle savedInstanceState) {
//		super.onCreate(savedInstanceState);
//		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//		setContentView(R.layout.activity_login);
////
////		Typeface tf = Typeface.createFromAsset(getAssets(),
////				"fonts/supermarket.ttf");
////
////		btStart = (Button) findViewById(R.id.buttonBookStart);
////		btStop = (Button) findViewById(R.id.buttonBookCancel);
////		booking_header = (TextView) findViewById(R.id.bookingHeader);
////		booking_header.setTypeface(tf);
////		btStart.setTypeface(tf);
////		btStop.setTypeface(tf);
//
//		// Context
//		context = this;
//		db = new InfoDB(context);
//		infos = new ArrayList<InfoEntry>();
//		showAllInfo();
//
//		if (phonesql == "nodata") {
//			Toast.makeText(bookActivity.this, "1eqwewqewq",
//					Toast.LENGTH_SHORT).show();
//			Intent newActivity = new Intent(bookActivity.this,
//					LoginActivity.class);
//			startActivity(newActivity);
////			btStart.setEnabled(false);
////			btStop.setEnabled(false);
//
//		} else {
////			Log.i("NAME-PHONE SQLite", namesql + "  " + phonesql);
//			Toast.makeText(bookActivity.this,
//					"�س  "  + "\n" + "�������Ѿ��  " + phonesql,
//					Toast.LENGTH_SHORT).show();
//			finishcheck = "1";
////			btStart.setEnabled(true);
////			btStop.setEnabled(true);
//		}
//
////		myIntent = new Intent(getApplicationContext(), ServiceRunQueue.class);
////
////		btStart.setOnClickListener(new View.OnClickListener() {
////			public void onClick(View v) {
////
////				myIntent.putExtra("PhoneNumber", phonesql);
////				startService(myIntent);
////				Log.i("StartQ", "Complete");
////			}
////		});
////
////		btStop.setOnClickListener(new View.OnClickListener() {
////			public void onClick(View v) {
////				stopService(myIntent);
////				Log.i("CancelQ", "Complete");
////			}
////		});
//	}
//
//	public void showAllInfo() {
//		infos = db.selectAll();
//		if (infos.size() == 0) {
//			phonesql = "nodata";
//		} else {
//			for (int i = 0; i < infos.size(); i++) {
//				phonesql = infos.get(i).getPhone().toString();
//				p = infos.get(i).getPhone();
//				CheckdataPhone = infos.get(i).getName().toString();
//				Log.i("Info",
//						infos.get(i).getName() + "'s info\n"
//								+ infos.get(i).getPhone());
//				Log.i("Info", "-------------------------------------------\n");
//			}
//		}
//	}
//
//	@SuppressWarnings("unused")
//	private void restartFirstActivity() {
//		Intent i = getBaseContext().getPackageManager()
//				.getLaunchIntentForPackage(getBaseContext().getPackageName());
//		i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
//				| Intent.FLAG_ACTIVITY_NEW_TASK);
//		startActivity(i);
//	}
//}
